import java.io.*;
import java.net.*;
import java.util.Scanner;
public class OldServer {
  
  public static void main(String argv[]) throws Exception {
    
    //We will use this to store the web address that the client will send us.
    String dvrMessage = null;
    
    //Create the server's "guidepost" socket. It should share a port with the client socket.
    ServerSocket welcomeSocket = new ServerSocket(33445);
    
    //Set up a specialized socket for communication between the client and the server.   
    Socket connectionSocket = welcomeSocket.accept();
    boolean receivingMessage = true;
    
    while(receivingMessage) {
      //Get the web address from the client.
      BufferedReader inFromClient = new BufferedReader(
      new InputStreamReader(connectionSocket.getInputStream()));
      dvrMessage = inFromClient.readLine();
      connectionSocket.close(); 
      receivingMessage = false;
    }
    System.out.println("The DVR Message received from the Client is: \n" + dvrMessage + "\n"); 
    welcomeSocket.close();
  }
}
